
#ifndef _MODULARITY_MAT_H_
#define _MODULARITY_MAT_H_

#include "../common/sparse_matrix.h"
#include "../common/matrix_op.h"

typedef struct _ModularityMatrix
{
	sparse_matrix_arr* Ag;
	elem* Kg;
	elem M;
	elem* Fg;
	elem Norm1;
} ModularityMatrix;

ModularityMatrix* make_modularity_mat(sparse_matrix_arr* matrix, int* indices,
									  int indices_count);

elem modularity_mat_get_cell(const ModularityMatrix* B, int row, int col,
							 int generalized);

void free_modularity_mat(ModularityMatrix* B);

void modularity_mat_mlpl_by_vector(const ModularityMatrix* Bg, Vector* x,
								   Vector* result, int is_generalized_matrix);

#endif /*  _MODULARITY_MAT_H_ */

